/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.visanyee.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 *
 * @author M
 */
@Entity
@Table(name = "s_drugitems")
@Cacheable
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@XmlRootElement
public class DrugItems implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "icode", nullable = false, length = 7)
    private String icode;
    @Column(name = "name", length = 100)
    private String name;
    @Column(name = "strength", length = 15)
    private String strength;
    @Column(name = "units", length = 50)
    private String units;
    @Column(name = "drugnote", length = 150)
    private String drugnote;
    @Column(name = "istatus")
    private Character istatus;
    @Column(name = "access_level")
    private Integer accessLevel;

    public DrugItems() {
    }

    public DrugItems(String icode) {
        this.icode = icode;
    }

    public String getIcode() {
        return icode;
    }

    public void setIcode(String icode) {
        this.icode = icode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStrength() {
        return strength;
    }

    public void setStrength(String strength) {
        this.strength = strength;
    }

    public String getUnits() {
        return units;
    }

    public void setUnits(String units) {
        this.units = units;
    }

    public String getDrugnote() {
        return drugnote;
    }

    public void setDrugnote(String drugnote) {
        this.drugnote = drugnote;
    }

    public Character getIstatus() {
        return istatus;
    }

    public void setIstatus(Character istatus) {
        this.istatus = istatus;
    }

    public Integer getAccessLevel() {
        return accessLevel;
    }

    public void setAccessLevel(Integer accessLevel) {
        this.accessLevel = accessLevel;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (icode != null ? icode.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DrugItems)) {
            return false;
        }
        DrugItems other = (DrugItems) object;
        if ((this.icode == null && other.icode != null) || (this.icode != null && !this.icode.equals(other.icode))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.rbh.risk.entity.DrugItems[ icode=" + icode + " ]";
    }
}
